<div class="layoutProject">
	<?php echo $form->create('Contract', array('action' => 'add')); ?>
    		<h2><?php echo __('contract'); ?></h2>
            <div class="largebloc2">
			<?php echo __('reference')." :".$form->input('ref', array('label' => false)); ?>
            <br />
            <?php echo "Client : ".$form->select('company_id', $format->buildClientArr($clientList), null, array('error' => 'Please select a Client.')); echo $html->link("add a new client", "/companies/add/");
			echo $form->error('company_id', 'Please select a Client.'); ?>
            <br  /><br />
            <?php echo "<h3>".__('list_profiles', true)."</h3>"; ?>
            			
			<div id="profil">
			<?php echo __('select_profils', true); ?>
			<?php echo $ajax->link(__('add_new_profile', true), '/profils/addform',array('update'=>'profil')); ?>
			</div>

            <div id="profils">
            <table>
			<?php echo $html->tableHeaders(array(__('label', true), __('dayli_rate', true))); ?>
            <?php foreach ($default_profils as $profils) {
                $profil = $profils['Profil'];
                $id = 'Profil-check.' . $profil['id'];
                ?>
                <tr>
                    <td><?php
                        echo $form->checkbox($id);
                        echo $form->label( $id.'.label', $profil['label']);?></td>
                    <td><?php echo $form->input('Profil-val.' . $profil['id'], array('label' => false, 'value'=>$profil['default_value'])); ?></td>
                </tr>
                <?php
            } ?>
            </table>
            </div>

            <br  /><br />
			<?php echo "<h3>".__('list_interventions', true)."</h3>"; ?>
            
            <div id="intervention">
			<?php echo __('select_interventions', true); ?>
			<?php echo $ajax->link(__('add_new_intervention', true), '/interventions/addform',array('update'=>'intervention')); ?>
			</div>

            <div id="interventions">
            <table>
			<?php echo $html->tableHeaders(array(__('label', true), __('value', true))); ?>
            <?php foreach ($default_interventions as $interventions) {
                $intervention = $interventions['Intervention'];
                $id = 'Intervention-check.' . $intervention['id'];
                ?>
                <tr>
                    <td><?php
                        echo $form->checkbox($id);
                        echo $form->label( $id.'.label', $intervention['label']);?></td>
                    <td><?php echo $form->input('Intervention-val.' . $intervention['id'], array('label' => false, 'value'=>$intervention['default_value'])); ?></td>
                </tr>
                <?php
            } ?>
            </table>
            </div>
            
            <br  /><br />
   			<?php echo __('estimated_dayli_rate')." :".$form->input('tjm', array('label' => false, 'id'=>'tjm')) ?>
            <br />
		<?php echo $form->submit(__('add_contract', true)); ?>
	<?php echo $form->end(); ?>
    </div>
</div>
